﻿using System;
using System.Data;
/// <summary>
/// Summary description for DirectServiceLogin
/// </summary>
public class DirectServiceLogin
{
    private ConnectionBase sgbdr;
    public DirectServiceLogin()
    {
      sgbdr= new ConnectionBase();
    }
    public  DataTable GetPermission(int groupId)
    {
        string sql = "select * from TPermissions where PermissionId in (select PermissionId from TGroupPermissions where GroupUserId=" +
               groupId + ")";
        return sgbdr.consultSQL(sql).Tables[0];
        //string sql = "select * from TPermissions where PermissionId=" + groupId;
        //return sgbdr.consultSQL(sql).Tables[0];

    }
    public DataTable GetPermissionId(string permissionLabel)
    {

        string sql = "select PermissionId from TPermissions where PermissionLabel = " +"'" + permissionLabel + "'";
        return sgbdr.consultSQL(sql).Tables[0];

    }
}
